<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改评论')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-comment-edit" th:object="${cmsComment}">
            <input name="commentId" th:field="*{commentId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">文章id：</label>
                <div class="col-sm-8">
                    <input name="articleId" th:field="*{articleId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">主楼|为0为主楼：</label>
                <div class="col-sm-8">
                    <div class="input-group">
                        <input id="treeId" name="parentId" type="hidden" th:field="*{parentId}" />
                        <input class="form-control" type="text" onclick="selectCommentTree()" id="treeName" readonly="true" th:field="*{parentName}">
                        <span class="input-group-addon"><i class="fa fa-search"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">发布人：</label>
                <div class="col-sm-8">
                    <input name="fromBy" th:field="*{fromBy}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">回复的人：</label>
                <div class="col-sm-8">
                    <input name="replyBy" th:field="*{replyBy}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">内容：</label>
                <div class="col-sm-8">
                    <input name="content" th:field="*{content}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">评论类型：</label>
                <div class="col-sm-8">
                    <select name="commentType" class="form-control m-b">
                        <option value="">所有</option>
                    </select>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">状态：</label>
                <div class="col-sm-8">
                    <input name="fettle" th:field="*{fettle}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">ip：</label>
                <div class="col-sm-8">
                    <input name="ip" th:field="*{ip}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">用户使用系统/或者浏览器：</label>
                <div class="col-sm-8">
                    <input name="userSystem" th:field="*{userSystem}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">用户浏览器：</label>
                <div class="col-sm-8">
                    <input name="userBower" th:field="*{userBower}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">讨厌统计：</label>
                <div class="col-sm-8">
                    <input name="nastyCount" th:field="*{nastyCount}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">喜欢统计：</label>
                <div class="col-sm-8">
                    <input name="likeCount" th:field="*{likeCount}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "system/comment";
        $("#form-comment-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-comment-edit').serialize());
            }
        }

        /*评论-新增-选择父部门树*/
        function selectCommentTree() {
            var options = {
                title: '评论选择',
                width: "380",
                url: prefix + "/selectCommentTree/" + $("#treeId").val(),
                callBack: doSubmit
            };
            $.modal.openOptions(options);
        }

        function doSubmit(index, layero){
            var body = layer.getChildFrame('body', index);
               $("#treeId").val(body.find('#treeId').val());
               $("#treeName").val(body.find('#treeName').val());
               layer.close(index);
        }
    </script>
</body>
</html>